Minor bug fixes in tests