Minor fixes

There's still a bug to fix that I'm having trouble with.