Various errors fixed in testing