More hacks to get it to work correctly.