Bug fix: fixed bugs