tests pass, fixes #248

Let me know if you want this done on the 1.0-alpha branch.