some bug fixes/changes and improvements to get rid of compiler errors, bugs and improve sample usability for bluetoothgatt