bug fixes, working copy