Fixed security / db cross bugs.