Some fixes and corrections