Fixed edge cases in rendering

Closes https://github.com/PistonDevelopers/piston/issues/530