fix for code and tests