More unit tests and fixes for share