Replaced == 'xx' by === 'xx'
Replaced (type == 1) ? false : true by type > 1