Added tests, corrected helpers.