Some fixes and adjustments