Pointer bug fix