Fix up some small bugs