Code fixes for cmake