Fix functional tests + add it to pre-deploy hook