Changed getSupportedMessageTypes to create a new array

This improves security at the expense of performance.