Fixed bad pointer usage