Minor refactoring, minor fix.