Fixed compile errors when compiling with clang.

 * the patch additionally fixes a crash of tophat_reports