fixed ruby bugs