Removed some compiler warnings. Restructured the header files to some extent.