Error handling improvements and a concurrency error fix.
Error handling improvements and a concurrency error fix.

qusma/qdms,leo90skk/qdms,underwater/qdms,Jumaga2015/qdms,leo90skk/qdms,underwater/qdms,qusma/qdms,KBurov/qdms