Move the R exitlevel test to where it belongs