Replace tabs in Makefile messages with spaces
Put a few unit tests in place
Fix a few scanning bugs uncovered by unit tests