Added metadata to .rr output, a couple bug fixes