Fixed some lgoic errors