bugfix and minor re-formatting

- fixed a bug for wrong inheritance
- minor re-formatting and typo correction