Fixed another casting issue.

Found one more casting issue that can occur when working with
attachments.
Changed tabs to spaces
Merge pull request #147 from jonlipsky/more-casting-issues

Fixed another casting issue.