Gary fixes

this was split off from develop yesterday. just a few bug fixes.