Several sundry bugs fixed.