Fixing code to match model changes for #31