fixed compilation error and failing test