Add logging and some fixes on deployment