Fixed a small issues with scroll snap back and code cleanup