small bug fixes for legacy browsers