fixes some little niggles that cropped up, I think it might actually work now
some cleanup