Fixed some compilation issues and style warnings