This is my first pull request so please bear with me. So I've been using this register function, but I noticed in the code that $model->validate() was called with $data as its only parameter, resulting in a fatal error afterwards.
This fixes it and -I think- respects Joomla's coding guidelines.