20141003_Safety_Fix

I fix the data storage variables as std::vector from double *. And also
I fixed some horrible mistakes...