Fixed bugs fith conditions