[FrameworkBundle] Fixes invalid serialized objects in cache