Min and max value where not correctly assign (read as string)