Add notice that source code has been modified per the terms specified by the author.

Fix miscellaneous bugs and formatting issues.