Fixing some dumb bugs