Fixing dictionary lookup