Fixed compile

Broke after merging in two incompatible pull requests.
Merge branch 'upstream/master'