Fixed some bugs and verified basic dispatch functionality