Adding better error messages to mgen compiler