Fix slider max value wrongly set in some cases