Fixing semantic errors