Hit level 22 with a lot of minmaxing and the help of a bug: If you buy multiple levels without installing the machines and then install a machine, it will be added to every level where it should be at the cost of only one (importantly for saving dwarves for lower levels) despite appearing to give the gold credit (as well as graphically showing) for all of them. This applies to all the machines but not to the dorfs who ride the carts or mine gold by hand...
Cool game though, despite the lack of end (?) and the repetitive late-game. Nicely done dev :)