Improved the implementation of functions pass() and fail().