Expand imports and use toArray() in handleQueuedOSCEvents().

Expand imports and use toArray() in handleQueuedOSCEvents().