added null check for delegated methods to prevent null pointer exceptions
fixed spacing and imports
Merge pull request #2 from munnja001/develop-patch-2013-03-05

added null check for delegated methods to prevent null pointer exceptions