Fix ordering of elements