Few logic corrections