Numerous bug fixs
Bug fixs