Add bounds checking to vecSet