Bugfix for issue #40

- added fix which is already in the 0.5 branch
- added attribute checking and default setting before creating a new resource