Added error on empty range