fix issue #479 and add spec for it

https://github.com/bem/bem-core/issues/479