Fixed bug regarding segmentation fault.
Added gitignore file.