General tweaks and fixes