bugfixes and makefile changed