Unknown profile 404

Fixes the bug when doing a lookup on an unknown profile.

Add an integration test for the unknown profile on lookup and headers.