Add more input validation

This comment applies to both these ```expect``` statements.