Prevent slide range overrun by checking the slide boundary.
Merge pull request #87 from gaku/master

fix #85: Prevent slide range overrun by checking the slide boundary.