re-applied earlier fixes