Re-wrote lib/fail.js