some fixes and coding style corrections as suggested in #68