More Account unit tests and bug fixes

* Add unit tests for more Account functions
* Various bug fixes for tested functions