Fix some bugs I think