Fix some bugs in Applications model.