Fixed bugs intriduced by PIMPL