Remove serv.py~ and remove unused global vars in serv.py