Updated to work correctly using a PaaS.