Fix warnings and errors.
Mostly minor fixes around variable usage and semicolons;
Changed the usage of the (now deprecated) "default" parameter setting.