Improved error checking on the compilation BATs