A few bug Fixes for $cordovaFile

Fixes for #388 and #371