some bugfixes and the makefile