Refactored IOCP and removed warnings