Implemented error checking for failed functor application.