Fixed the TypeError occuring when only 1 listener is on the relay.

This adds some extra sanity checking in the parser.