Fixed bad implicit conversions and now works in safari