Small code tweaks