Fixed some severe errors