Added log levels.
Fixing output and minor issues.