Some cleanup, simplified error setting