Even as this is a bit an older problem, it just happend to me as well and I think I just found the cure.
The reason for the error is an added linebreak in the file description at the top of the document. I think it’s done by Nano when you open the file the first time.
just add a «#» sign at the beginning of line 2 and all is fine.