Add more tests, bounds checking for rpg()