Fixed various mistakes