Makefile
tests + some fixes