Apply same changes as in grovy-devel to solve issue #3