Check that entity is at correct position in entity list before removal.

Signed-off-by: Ross Allan <rallanpcl@gmail.com>