Shortened code; catch error if directive is weirdly formatted.