Fixing a few more bugs