Fixing a bug where randomly generated strings would have very low entropy
Fixing some bugs in sending password reset mail