Reduced linage and fixed IF bugs