Fix issue #72 and some code formatting fixes.