Switch to splitlines in apply.py as well