Style fixes. Error handler for promises