Minor optimisations and updated libs