Added password support and fixed bug.