BUG: Fixing a few errors