Should fix some bugs