Improved logging / diagnostics