Fixed an integer overflow bug in BlockTemplateTransaction.cs.

Fixes #341
Fixes #443