Code style and other fixes