Fixed pointer issues