Bug fixes and minor improvements made while developing sample app