Closes #8

Note: There is some "legacy" code here that might not be doing much or
even hurting. It does fix the mentioned issue though.