static local variable fixes for WARN_ON_ONCE

This fixes issue #394.