use case-insensitive header stuff for stubs

closes #389