cleanup unreachable code
fix Sprintf formatting
Merge pull request #498 from alouche/fix_sprintf_unreachable_code

Fix sprintf formatting and cleanup unreachable code