Fix kbase 954

Fixes for problems documented in JIRA issue KBASE-954