Fix #428 by replacing getClass.getClassLoader with Thread.currentThread.getContextClassLoader