Minor fixes
Minor refactorings