Fixed issues with the implementation of Johnsson Trotter algorithm