fixed some printf format specifiers
wrapped some assertions into TRI_ASSERT_DEBUG