Minor adjustments and bugs