Initialise the history at startup
Initial script fixes