Added save script support and fixed a few bugs related to the server callback