Fixing logical errors.