Merge pull request #725 from JoesCat/master

Stop possible overflows
Merge pull request #726 from JoesCat/master

Trailing blanks and buffer overflows