JBIDE-11065 PR 40, with some changes >> master