Fixed wrong parameters of Cache::write