Fixed bugs in sample app and library

Signed-off-by: Ralph Pina <ralph.pina@mapmyfitnessinc.com>