Some fixes in new and edit