Added Makefile. Minor bug fixes.