Fix for GRAILS-9954 and GRAILS-9956