Fix pointer issues causing compiler errors