Fixed some sorting in forms