Fixed nasty bug in mail sending