Fixes type lookup NPE bug