Fixed issue whereby last range was ignored.