Fix sprintf formatting and cleanup unreachable code

Minor changes.