Add more checks to vector functions

This causes, eg, ```vector.add({}, 5)``` to fail properly.