Bug fix
Minor tweaks