Fixed various warnings and errors after import of kirils work