Added null checks to public methods