Java 6 compatibility and https fix