Improved debugging

Version 0.4.1:
+added a debug option to makefile
+fixed errors revealed by this option

Signed-off-by: lg188 <lander.ghekiere@gmail.com>