Previously, the view checked $privateKeyId with ! operator, which incorrectly treats 0 (localhost key) as falsy. Changed to explicit is_null() checks to distinguish between null (no key) and 0 (localhost). Added test coverage for both cases.