BS: Cleanup and bug fixes