Some changes to Geert's pull request to make them ML5-friendly.