Ensure the prefix is an array before pushing or unshifting

This was causing issues for me. It was only throwing a warning but it was not actually pushing or unshifting anything which resulted in no work being done in loadClass.

Ping @pmjones