Test bugs fixed