Fixing position of error and result in callbacks, adding throwErr and tryCatch functions to util