Fixed invalid variable name
Redirected errors stderr to stdout (2>&1)
Errors to stdout
Fixed invalid log messages
Bugfixes