Fix issues 764 & 761

Unstable version fixes for #761 and #762. Running gulp test doesn't work in unstable version, so this is not clean.