Fixed NPE when applying a null contract
Merge remote-tracking branch 'origin/master'