keep perms as int. Fixes #609