Fixed some minor bugs with pointer.