Fixed a few test bugs