Add initial (not fully tested) support for r parameter