fix bug which did not allow reading coordinates and use get_next_record
afterwards. Add corresponding test