Polish things up

Fixes for some small bugs.