Fixed a bug in database and scheduler, other than some comments and clean up it's in a deliverable state