fix code style

mostly tab2space
add error handling for create functions

fix #18
0.2.4