Replaced most NULL pointer checks with assertions. Regular checks are still in use in situations where the program can continue to run if a NULL is encountered.
Fixed a bug in the copyLinkedList function that could cause it to release memory belonging to the original list.