Various fixes from Fuma