Added missing os.remove() to if statement.