Added error log middleware. Fixed setup.sh issues.