Fix some misc small bugs.