Fix typos and cleanup the host code and the Makefile