Changed as.double to as.numeric.