Make sure that your files always have an empty new line at the end. Here's why: http://unix.stackexchange.com/questions/18743/whats-the-point-in-adding-a-new-line-to-the-end-of-a-file?answertab=votes#tab-top

Try to make sure that everything is indented consistently, with 2 spaces. Make sure that you've got these settings in your Sublime Text settings https://gist.github.com/HeroicEric/77c860d2fe8d7ae0a98f