Corrected signed/unsigned mismatch warning.
Reformatted the source file.
Rename some tidy functions and updated associated programs.