bugfixes, improved recovery from data errors, optimizations