Tweaked v3.5.2 to be as close to v4.0.0 as possible. Also fixed several
spelling mistakes in JavaDoc comments.