Added tests and updated expected results for recent bug fixes.