Fix some bugs + more testing

It seems I sometimes like to write code just to write it.  It might
**look** perfectly valid, but doesn't actually **do** anything... or at
least doesn't do what it's supposed to do.