Fixed assert on Win8.1. Thanks to jonwfreeman.