Fixed the error in compilePermuations