Fix Rails errors