fixed some problems with autorun, fixed #782