This fixes issues #3 and #2