Fixed several errors in classes