Add tests for element end positions