Fix some mistakes add more testing