Bad memory access in regular_points()