Cleaned up the network controller a bit.
Merged from master.