Added compatibility with R17