Bugfix/speedup