Fix bug of assuming that vectors had size > 0.