fixed warnings when compiled without legacy-mode