fixed confdir bug, some cleanup