Bug fix for async case, and moved to Java 1.8