Fix some issues from SCA

Fix some compiler warnings and style issues.