changes to rmagic to match PR