Fixes aes a bug related to socket synchronization in debugging mode