Josh: Lots of fixes and additions