fixed style problems; made failure more informative