Fix wrong prints on errors