Fix converting of 'mean' value depending on value type