Tweaked a few things trying to fix issue #16, will come back to it later.