Some reformatting done by astyle.