Updated to work with Groovy.