Rectified some errors in conversion to ruby object.