Bug fixes to account code.