Error reporting added to all functions.