Add gitignore, and fix issues #18 #22 #30