Bug fixes

Bug fix rollup combining many smaller fixes into one place

Closes:
  #156 
  #163 
  #164 
  #165 
  #166 
  #168