Unicode Encode Error fixed and exception handling

 * Fixed PEP8 issues and added that check for regular debug
 * Missed log debug calls were added

Change-Id: I6018df2bbf836f323fc9d0807708d2988d2a9254
Merge "Unicode Encode Error fixed and exception handling"