Made changes from GrailsBase.