Hack so it appears to work... I'll fix this when I'm more experienced and have the time.