Fixed a bug when finding assigned user index
Null pointer checks