Fix issue 761 & 762

Gulp test passed on my machine.