some restrictions added to r config option, error handling improved