Various fixes (not done yet)