Added tests for all functions.