Fixed several mistakes