Fixed extreme value bugs