Fix warnings, clean up test includes and Makefile