Only detect Hadoop libraries when  needed
Fix bug