misc changes and bug fixes
branch merge