Code clean-up

It have some minor patches.