Checking list-keys which don't exist causes the initialisation to fail

Added a check for the existence of a key in a list before comparing the value of that item in the list.