Some fixes and changes