Updated the remove function for error checking and better fault tolerance.

Fixed some grammar errors in a splitstring comment.