The descriptor management code needs revisiting. It needs to be cleaned up, and perhaps a different approach taken with it.