Update tests and fix some minor issues