Support snapping to center

Also minor formatting corrections