#466 avoid some ugly exceptions in the JavaScript console