Code fixes for MTWR

Hey JP, I've got some code fixes here.