Added null checks and tests.
Merge branch 'master' of github.com:PaulTomchik/Algorithms