Fixed a bug in MapToMinWithInverse