Added authorised application id creation. Fixed some bugs on message reception.