fixes #907 and fixes #908

Pretty simple.
Very kludgy, but I'm okay with it for M13.