Fix bug in generating methods in irb mode