some fixes for JDK 8