Fixes #29.

Squashed commit of the following:

commit eb22cd5c0c565d6712338a934155cc6e25b526ea
Author: Jeremy Kahn <jeremyckahn@gmail.com>
Date:   Sat Feb 16 18:59:33 2013 -0800

    Potential fix for #29.

commit 40f28804ea139783be28cada236c6bd0de2d5fec
Author: Jeremy Kahn <jeremyckahn@gmail.com>
Date:   Thu Feb 14 21:20:45 2013 -0800

    Adds failing test for #29.