Adding logs.
Some bug fixes.