fixes for get_next_value