better diagnostic output on failure