Tweaks to make functions work again