Signature fix; add some unit tests