Adapt file layout depending on hash size
Adapt file layout depending on hash size
Several small improvements