Testcases for some fixed bugs

This just fills in a few bugs that needed tests.

r? @alexcrichton