More misc bug fixes found during unit test porting.
Ported the pointers unit test from C++.