Cleaned up nvbg code.