Enabled DEBUG log statements by default.
Fixed several bugs; now running as expected.