Added check for existing account and other small fixes.