Improvements to timeout handling (sys.maxint is not acceptable to glpk)