--- a/src/amuleAppCommon.cpp
+++ b/src/amuleAppCommon.cpp
@@ -162,10 +162,10 @@
 			strURL << thePrefs::GetYourHostname();
 		} else {
 			uint32 clientID = theApp->GetID();
-			strURL << (uint8) clientID << wxT(".") <<
-			(uint8)(clientID >> 8) << wxT(".") <<
-			(uint8)(clientID >> 16) << wxT(".") <<
-			(uint8)(clientID >> 24);
+			strURL << (clientID & 0xff) << wxT(".") <<
+			((clientID >> 8) & 0xff) << wxT(".") <<
+			((clientID >> 16) & 0xff) << wxT(".") <<
+			((clientID >> 24) & 0xff);
 		}
 		
  		strURL << wxT(":") <<
