Fixes to update.pl and tidying up