Fixed path handling and byteBuffer exceptions

Change-Id: I27f98ff8b05b6544b1c9dd2ccd49ec32b0151d93