Fix locks initialisation and change error messages