Better error handling in compiler