Fix some test bugs