Fixes for JIRA  335, 372