updated corrected versions of optimized routines permute_dimensions_int() and transpose_replace_int