Lab 9 bug fix

Fixed a bug where removing a node sometimes acted incorrectly.