Fix some issues

Fix some style and consistency rule violations in the code.