Fix compiler error at invalid trait param