Last fixes for integration into third party code