Fixing a couple bugs found.