Merge pull request #1007 from alex/warning-stacklevel

Warn at the right stacklevel