Make this part of the code at least look similar

First we assert that s != NULL.

Then we check if a != NULL, and return -1 if it is. That just makes no sense.

Change the check for a to also be an assertion, and make things at least look similar.
Revert "Make this part of the code at least look similar"

This reverts commit 701af5d057f523c714517085469dec556aa76b28.

The test suite apparently expects this to be there... do this properly
later on.