Fixed snapping bug