Add a test and fix 2 dependency issues