Fix for crashing on polyline building