Clean up some logging code, fix BC pump memory leak. Fixes #494

Signed-off-by: Ross Allan <rallanpcl@gmail.com>