Add an option that makes it possible to ensure that the last point is exactly for Tmax; make sure that we never exceed Tmax

Good idea to test this case, but I bet it will work.