fixes for receiving apdu

Change-Id: I110f6b14843c8c8bfd69f57149cfde3d5e13ba19