Fixing the issues related to how python handles column and row vectors of a matrix