Fixed bug in DoP JavaScript