Fix bugs in creation form and fix warnings