Some typof checks improved