system regulator + some minor Rcode changes