Fixed 'pspec is Nonetype' error