Fix tests, fix one bug, fix doc build