GROOVY-6268: Tests updated. Code formatting and bug fixes.