Changes to fix database problems on Mac OS X 10.8 that might be due to a different version of sqlite:
$ sqlite3 --version
3.7.12 2012-04-03 19:43:07 86b8481be7e76cccc92d14ce762d21bfb69504af