Fixed a bug when sign-extending the sample minimum