Fixing Pasha's bugs.