Fixed bug in asynchronous output, added limitations on memory waiting for write