Optimized sliding and fixed bugs.