ecmascript: Fix some problems with cacheGet() cachePut()