Fix bugs in -j and -r options reported by Godmar Back.