Re-implemented how continuations are handled on transaction level.
Fixed some errors and warnings on GCC/clang.