Fixed a couple of bugs. Added proper .gitignore