Fix for issues #13 and #14

Hi, thanks for this library, very useful. Learned about it after VO2 post. 

Had similar issue as 13 and 14, fixed in my environment with the following patch, hope it helps.