Fixed some sorting layer issues