Solve prepare issue during transaction. Fixes #27