Whitespace fix
Add bit counting
Fix some warnings
Enable compiler optimization