minimal speed improvement / bugfix