Diagnostics and small fix