miscellaneous fixes

these are long overdue fixues. ilsgateway has been running this on a branch for a long time.