fixed handling of ReflectionExceptions in factories