fix substring negative index

The order of the if statements made the second one useless, starting a
substring with a negative index returned Null as (start>maxSize) is
apparently true in that case.