Fixed crash on windows (caused by a variable beeing a large negative
value).Vlj, can you please have a look!