Fixed some snapping bugs.

I am not sure if the second commit is done right, you tried to separate the snap components from core, but I do need to reference at the core to fix the bug.