Fixes issues spotted by @Golmote

https://twitter.com/Golmote/status/445143271632031744
https://twitter.com/Golmote/status/445145405857497088