Fixed send and receive command functions