fixes to Ivo's PR