Mostly fix this perl script and some Obj-C warnings