Fix build issues related to Rails v4