Fix porting errors in G12, G1X, IXUS310, SX30 & SX40.Found by automating the generation of the code files (based on modified version of CHDK-PT code).