various bug fixes
14 files changed