added better workaround for missing raw mode for as.vector