Fixed test and added public to beforeSave.