Bugfix / speed improvement