Revision 1.02

Source code tidy-up to remove compiler warnings and improve clarity.