Fixed null dereference when deleting first node.
Merge pull request #392 from michaelsproul/null-node-deletion

Prevent null pointer exception when deleting the first node.