Tighten dependencies and fix tests