Bugfix: Object must be defined before using it in type checking