Some more bugs fixed