Final fix. Seems to be working.