[Tests] Fix some minor bugs.