Replace size_t with signed integer in perm.hpp