Fixed several small errors