Minor bug fixies