Fixes

various script fixes including problems with grep, shallow git checkouts and google code, invalid chmod, and a fix for broken error reporting.