Two patches from Scott McKellar: