Fixes issues #12 and #13