Add compatibility with R15 and fix #2