Fixes #20 - Add a check for null class