Fix crashing bugs found with sysbench

Fixes #85 
Fixes #86