Improve detection of pointer types