Fix two issues around cache and analytics