Fixes for firefox and safari

todo: test in ie
Merge pull request #18 from dinoboff/master

Fixes for firefox and safari