Fixed bug in rcode