Thanks @i_mazlov !
So, I figured what the problem was, it was kind of my fault due to my not so good scripting skills, lol
I'll explain the issues I was having anyway:
Issue 1
File save state was constantly unsaved. If you click to save, then click to close the document, it would ask if you want to save the document. CTRL+S didn't do any difference.