added print element, fixed an encoding problem in m replacement