Fix problems with length handling in NetworkManager