Fixed fatal error on invalid class, added check for ext fields