Merged fixes

includes all fixes so far, so some may not be needed to merge, but I think that is the purpose of github--to only change changed files.