Fixed bug when -n used with -r