Added handling of Nullpointers to some methods and updated Javadoc for
some methods