various bug fixes
additional bug fixes