Add a utilities class, fix some errors.