Errors fixed in insert queries