fix for #793, style cleanups

- [ ] writes tests to check for proper state