Tweaks and performance fixes