Fixes bugzilla 16695

Simplified match using active patterns
Added null guards to the Project properties
Merge pull request #300 from 7sharp9/bugzilla-16695

Fixes bugzilla 16695