Fix bugs, improve messages