Fix some bugs, maybe works?