Fixed wrong behaviour when input step leads to end value higher then max value