generator: check for property key before accessing it, add some error messages