Bug fix and Firefox support

I had to create a custom mapping for XBOX360 controller on Firefox. However, the mapping is still a bit wrong (R and L triggers are not working, they are shown as axis), as the browser does not map the buttons according to the current specifications.

This PR also includes a fix of a bug that had broken the lib.