@eyeamgj, yes, they should be reversed.
given that d is public key, e is private key
Let consider A wants to send Msg M to B
then A is calculate M' = Md mod n , B is calculate M = (M')e mod n
but they give as M' = Me mod n , B is calculate M = (M')d mod n
therefore M and M' are need to interchange, otherwise M' is Plain text and M is cipher text