Added missing include <arpa/inet.h> for htonl()
Code cleanup