Fix two critical problems