Added logging, fixed build errors