Fix for #12

Making a pull request to fix #12. 

Have merged the recent commits with our fork before making this request. The commit in question on our fork is dbc2ca978a674cec19cbe4ccd0d1d79dbdc461b3.