ptr=NULL
Improved .gitignore and makefile slightly
fixed error in debug code