Various small bugs fixed.