Split unit test and fixes.