Fixed some inconsistant sorting behaviour