Fixed many errors