Sample app and some fixes