[JBWS-3854] / [JBWS-3855] Misc fixes + additional testcase