Workaround some JDK bug.