Fix small bugs in PTR support.