Several bug fixed, but still need a little work.