Fixed a couple of bug when first setting up