Added improvments to database converter and enddir handling