Auto-detect keys

Key can also be empty (null)