handle ways without refs/nodes in ring builder

fixes 'index out of range' panics