Adapt code to recent model changes