JBIDE-18413: Applied suggested fixes by @fbricon