Fix for #1: Allow loop callbacks to pass back error