Made a couple of bugfixes.