Fixed edge cases in rendering

Closes https://github.com/PistonDevelopers/piston/issues/530
Merge pull request #531 from bvssvni/master

Fixed edge cases in rendering