add application tests & fix some behaviors