improved autolibs and errors handling, fix #3080