Various fixes here and there