Improved logging of error with stacktrace. Removed a few redundant TODOs