Fixing errors in spwvd()