Fix compatibility in ApplicationMain