Updates code to account for core updates and a bugfix.