TMI-15: Fixed some issues introduced in later JREs (at least 7u45).