Fixes some bugs with that.