Moved test functions to bottom.