some fixes (80%)