Merge pull request #132 from Syke94/master

Fixed NullReferenceException