added onFailure and Fixed tests
Merge branch 'master' of https://github.com/xjdr/util