Improved build system and error reporting