If variable is required, raise an error if missing

This addresses issue #1