Fixes issue #1256 by sychncronizing with ZF2 dev branch