Corrected patch offset
Added new patches to fix a build warning and to expose context and nonce as parameters