More error checking
Change build system, minor changes