Bugfixes + speedup