Fixed logical error in RS1