some fixes for Java6 compatibility