Fix Network.check_valid_range and some other things

**Resolves issues #742 and #738.**
I always forget about this trick