Slightly improve testContingsToString