Correct byte code generation: calculate max frames and locals by hand (they're constant anyway) to avoid altering the existing byte code; fix putfield operation.