Fix build errors when assertions are enabled

Compiling without NDBUG defined produced some errors which are fixed in this patch.
Also a duplicated line in the Makefile was removed.