Fixes some bugs that arose due to changes in master