Fixed rhs sort checking
Corrected error message