Fix for #215 and some other related improvements

There should never be `?>` at the end of php file with classes. Also there should be empty line, just like github points out.