Added .gitignore
Fixed casting bug.