Fix bugs and formating

Fix the bug that made mode=1 and mode=3 failed on mac os 10.9 (at
least). (bloch.c:129).
Formatting