some advertisement fixes
Let debug show packet data.
some coding style fixes