Fixed #6. Added Firefox compatibility.