Issue with transactions fixed.

The pass-by-reference commit variable did not retain the value from within
the block, hence the transaction would not always be committed. This issue
have been fixed by removing the pass-by-reference variable and instead
expects the block to return whether to commit or rollback, as described
within the method documentation.

Also, removed some trailing spaces on blank lines.