Fix creation of state root and upload dirs