Fix incorrect handling of pointer types