some minor fixes and another helper class