coding style and small fixes