a few tweaks to pass r cmd check