Improve pointer types detection