Fixed typo in database module.
Some changes in kernel.