Fixed some test bugs