Fix entity at the end - issue #77