Fixed some minor defects