Core. fix build and some codestyle changes