fixed bug in rat_quad for RW