Fixing a bug in transaction generation