Fix error and expand tests.

Note to self: I should really first write test before I publish the
package...