Fixed plugin interaction with database.