Minor changes to engine: wait function; index.html init