Fixing model maintenance code