Fixed possible pointer issues.