fixed issue with reference-error on window.device and pg3+. closes #8