Corrected pointer issues