Bugfix + little renaming to get code more clear.