Made the current IP check more robust
Cleanup