bugfixes / speedups