coding style and other fixes