Improved PDO usage

1.1

This version improves PDO usage, and fixes some bugs. See the full
changelog.