Minor bug repairs