bugs

found a few bugs with the prepared statement code again on IRC (one in the stuff i wrote earlier!). these fix them for our tested use cases