Bug fix and other work