Fix binddn and add mirror mode support.