Fixed many mistakes