Fix/element position

This PR contains:

1. A failing spec which shows a javascript error while trashing an element containing a richtext essence.
2. A fix for that bug, so the failing spec turns green.