fixes from bergroth