Fixed another nonetype errorbug in the device parsing function.