Changed raise to fail and fixed all code smells (i.e. found by robocup) in utils.rb.