Fix bug in test program

Fix bug in testprogam which leaves memory space argument untested for invalid value.
Enabled coverage test compile flag in Makefile.