Fixed several obvious errors