Minor fixed and reformation of some code.