Fixing run time exception: reference into empty vector  

Replacing it with more predictable behavior.