src: fixed some bugs