Fix #664. Fixes using a NULL entity.

Fixes a bug where the rope would be removed (and hence a NULL entity - but not nil) causing errors to be spammed.