Fix bad code