Fixed null pointer exceptions
Added a transiet vector