Fixed some condition handling
Can specify input file