Fix issues with functions not being called right.