Sets/resets the flags on entity selection

Solves the issue #55