bugfix and makefile flags