Fix Java 7 usage and clean patch