Fix install errors

This is about #887 .
There are no errors now, only warnings. I don't know whether there is a way to check if there's just one account so we don't have to call the function which causes the error at all!

Btw, I have taken the liberty of changing a function name!