Copy the script from master to fix #31