Minor adjustments and code cleanup