Fix several RS bugs