Some fixes and cleaning