Bug fix and rejig