Some bugfixes and a gitignore