Fix the tests & build. Close #549.