Fixes a bug in attachment handling and another in email subject decoding

This fixes charlierguo#31 and charlierguo#32