Fix bugs in snap and restrict

 - make snap.elementOrigin `null` by default
 - fix a bug when restricting without elementRect