Improved compilation error reporting and added support for generics