Fix bad references