Fix createitem to work properly in 40d with more item types