Fixed some important errors