fixed an error and a bug.