Fixed main file handler.