Fixed most of the errors that prevented rails from running