m -> k, n -> k
backported bug-fix to Magnify