Fix compile error.
Improve logging