Minor bug fixes