Nothing was changed if the mode was invalid.
Forgot to check if the wifi-device section belongs to the wifi-device being listed.