some bug fixes/changes and improvements to get rid of compiler errors, b...

...ugs and improve sample usability for bluetoothgatt