Minor bug corrections