Cleaned up code and removed old UPnP stuff.