General bug fixing.