Implement #CSB-36
Also moved a log statement to a better place.