Merge remote-tracking branch 'nagn/autobalance'
Removed unneccessary with-block