Fixed issue that was causing AttributeError messages