Fix bugs and change parameters