Performance fixes