Vector and rand improvements