BUG: fixed nested with statement bug and add python2.6 to travis