Fixing some bad bugs