Fixes a possible java.lang.InternalError. Reported by Server Test on the users mailing list.