Better error detection (#72)