Issue #64, #66, #67, #69: removed diagnostic code, minor tweaks