Added error checking to rutils structures