small bugfixes in status sorting