Fixes for ZF 2.3 and doctrine 0.8