Some fixes (crash when adding raw "x=" field, "dirty" handling)