BUG: ordering of rows inconsistent