Compilation fixes for Windows

Windows fails to compile currently, which these changes fix. The Jun 22 commit is from the pending #293 pull request.