Added some null-string & security checks