This patch fixes  some PHP Notices and an extraction bug on OSX