Minor bug fixs