Fixed trap warnings