Fixed runtime errors, including some syntax errors.