Re-add catch for AttributeNotFoundException.

This exception seems to got lost somewhere between 1.0.6 and 1.1.0. Fixes #158
Updated and test for #158