minor gem bug fixes