Fix test impact function

Make the unit tests pass for #334