There was a thread recently that mentioned that they were asked to use only lowercase in username. I noticed that in the code you gave to incorporate the registration part into the login widget, and it was stating lowercase and/or numbers only, One of my testers happened to use a hyphen in the registration form (the main one, not the widget one) and the registration never happened, so i guess it is right that there are some limitations in the characters used.
Just for information, in case it is useful to someone else.