Add tests for misc functions