Fix empty vector bug