Added .gitignore
Added a little bit of additional error checking