Varia bug fixing