Increased database consistency, added logger.