Some fixes (a lot!)