Fixes compilation for ubuntu 14.04. This is originally by @aaronelmore at 5a8d79670eb4cd1bcb80149b664b59e60cd00e67