Small refactoring, warnings corrected