Fix bad ruby code