New version with new auto_partition code. This should fix issue #180 (in my tests it does)