Added catching of null pointer exception in type resolution.